package cn.biz.imp;

import java.util.List;

import cn.biz.BrandBiz;
import cn.dao.BrandDao;
import cn.entity.Brand;

public class BrandBizImp implements BrandBiz {
	private BrandDao brandDao;
	
	public BrandDao getBrandDao() {
		return brandDao;
	}

	public void setBrandDao(BrandDao brandDao) {
		this.brandDao = brandDao;
	}

	@Override
	public String insertOrUpdate(Brand brand) {
		try {
			brandDao.insertOrUpdate(brand);
			return "success";
		} catch (Exception e) {
			return "error";
		}
	}
	
	@Override
	public Brand getBrandById(Integer id) {
		return brandDao.getBrandById(id);
	}

	@Override
	public List<Brand> getAll() {
		return brandDao.getAll();
	}

}
